import request from "@/utils/request";

export const getArcticelList = (params) => {
    return request({
        method: 'GET',
        url: '/v1_0/articles',
        params
    })
}

export const getArticleDetail = (articleId) => {
    return request({
        method: 'GET',
        url: `/v1_0/articles/${articleId}`
    })
}

export const addFollowing = target => {
    return request({
        method: 'POST',
        url: `/v1_0/user/followings`,
        data: {
            target
        }
    })
}
export const cancleFollowing = target => {
    return request({
        method: 'DELETE',
        url: `/v1_0/user/followings/${target}`,
    })
}

export const addCollections = target => {
    return request({
        method: 'POST',
        url: `/v1_0/article/collections`,
        data: {
            target
        }
    })
}
export const cancleCollections = target => {
    return request({
        method: 'DELETE',
        url: `/v1_0/article/collections/${target}`,
    })
}

export const addLikes = target => {
    return request({
        method: 'POST',
        url: `/v1_0/article/likings`,
        data: {
            target
        }
    })
}
export const cancleLikes = target => {
    return request({
        method: 'DELETE',
        url: `/v1_0/article/likings/${target}`,
    })
}